
package thread;

public class MyThread extends Thread {
    String name;
    int n;
    MyThread(String name, int n){
        this.name=name;
        this.n=n;
        System.out.println("Thread "+name+" da duoc tao...!");
        start();
    }
public void run(){
    for(int i=0; i<n; i++){
        System.out.println("Xin chao, toi la: "+name);
        System.out.println("Chuc thanh cong, bye bye...wow...");
    }
}
public static void main(String args[]){
    int n=10;
    int nt=4;
    for(int i=0; i<nt; i++){
    MyThread t=new MyThread("Thread "+i,n);
}
}
}    
